package org.example.test.domain.activity;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.example.domain.activity.model.entity.MarketProductEntity;
import org.example.domain.activity.model.entity.TrialBalanceEntity;
import org.example.domain.activity.service.IIndexGroupBuyMarketService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class IIndexGroupBuyMarketServiceTest {
    @Resource
    private IIndexGroupBuyMarketService indexGroupBuyMarketService;

    @Test
    public void test() throws Exception {

        MarketProductEntity marketProductEntity=

        MarketProductEntity.builder()
                .userId("xiaofuge")
                .source("s01")
                .channel("c01")
                .goodsId("9890001")
                .build();
        TrialBalanceEntity trialBalanceEntity=indexGroupBuyMarketService.indexMarketTrial(marketProductEntity);
        log.info("请求参数:{}", JSON.toJSONString(marketProductEntity));
        log.info("返回结果:{}",JSON.toJSONString(trialBalanceEntity));



    }

    @Test
    public void test_indexMarketTrial_error() throws Exception {

        MarketProductEntity marketProductEntity=

                MarketProductEntity.builder()
                        .userId("xiaofuge")
                        .source("s01")
                        .channel("c01")
                        .goodsId("9890002")
                        .build();
        TrialBalanceEntity trialBalanceEntity=indexGroupBuyMarketService.indexMarketTrial(marketProductEntity);
        log.info("请求参数:{}", JSON.toJSONString(marketProductEntity));
        log.info("返回结果:{}",JSON.toJSONString(trialBalanceEntity));



    }

}
